package com.baor.controller;

import com.baor.dao.DistributionConfDao;
import com.baor.service.DistributionOrderService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class DistributionOrderController {

    @Autowired
    private DistributionOrderService service;

    @Autowired
    private DistributionConfDao confDao;

    @RequestMapping("/disOrder/search")
    public AjaxResult<?> search(@RequestBody Map<String,Object> map){
        return service.list(map);
    }



    /**
     * 会员佣金
     * @param map{
     *     "siteId":1,
     *     "source":"佣金",
     *     "startTime":"2024-05-22 19:28:40",
     *     "endTime":"2024-05-22 19:28:40"
     * }
     * @return
     */
    @RequestMapping("/money/list")
    public AjaxResult<?> moneyList(@RequestBody Map<String,Object> map){
        return service.moneyList(map);
    }

    /**
     * 会员余额
     * @param map{
     *     "siteId":1,
     *     "source":"佣金",
     *     "type":"余额",
     *     "startTime":"2024-05-22 19:28:40",
     *     "endTime":"2024-05-22 19:28:40"
     * }
     * @return
     */
    @RequestMapping("/yue/list")
    public AjaxResult<?> yue(@RequestBody Map<String,Object> map){
        return service.yue(map);
    }


    @RequestMapping("/distribution/total")
    public AjaxResult<?> disTotal(@RequestBody Map<String,Object> map){
        return service.disTotal(map);
    }


    @RequestMapping("/test")
    public void test(){
        String sql = "select * from t_user where user_id = 1";
//        confDao.s(sql);
    }

}
